package com.slkj.shilixiaoyuanapp.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created  on 2018-08-20
 *
 * @author 唐开阔
 * @describe 公章详情
 */
public class ToolOfficialSealDetailEntity implements Parcelable{


    /**
     * id : 10
     * intime : 2018-08-20
     * applytime : 2018-08-20 00:00:00
     * filename : 123
     * filecopies : 1
     * filetype : 原件
     * type : {"dId":1,"dName":"公章"}
     * state : 0
     * body : 用用
     * auditor : [{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"},{"uId":2,"uName":"任浩","headImg":"/images/school3/moraCharacter/1534741401121.jpg"}]
     */

    private int id;
    private String intime;
    private String applytime;
    private String filename;
    private int filecopies;
    private String filetype;
    private TypeEntity type;
    private int state;
    private String body;
    private String refute;
    private boolean urge;
    private int myState;

    private ArrayList<PeopleEntity> auditor;

    protected ToolOfficialSealDetailEntity(Parcel in) {
        id = in.readInt();
        intime = in.readString();
        applytime = in.readString();
        filename = in.readString();
        filecopies = in.readInt();
        filetype = in.readString();
        type = in.readParcelable(TypeEntity.class.getClassLoader());
        state = in.readInt();
        body = in.readString();
        refute = in.readString();
        urge = in.readByte() != 0;
        auditor = in.createTypedArrayList(PeopleEntity.CREATOR);
        myState = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(intime);
        dest.writeString(applytime);
        dest.writeString(filename);
        dest.writeInt(filecopies);
        dest.writeString(filetype);
        dest.writeParcelable(type, flags);
        dest.writeInt(state);
        dest.writeString(body);
        dest.writeString(refute);
        dest.writeByte((byte) (urge ? 1 : 0));
        dest.writeTypedList(auditor);
        dest.writeInt(myState);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ToolOfficialSealDetailEntity> CREATOR = new Creator<ToolOfficialSealDetailEntity>() {
        @Override
        public ToolOfficialSealDetailEntity createFromParcel(Parcel in) {
            return new ToolOfficialSealDetailEntity(in);
        }

        @Override
        public ToolOfficialSealDetailEntity[] newArray(int size) {
            return new ToolOfficialSealDetailEntity[size];
        }
    };

    public int getMyState() {
        return myState;
    }

    public void setMyState(int myState) {
        this.myState = myState;
    }

    public boolean isUrge() {
        return urge;
    }

    public void setUrge(boolean urge) {
        this.urge = urge;
    }

    public String getRefute() {
        return refute;
    }

    public void setRefute(String refute) {
        this.refute = refute;
    }



    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getIntime() {
        return intime;
    }

    public void setIntime(String intime) {
        this.intime = intime;
    }

    public String getApplytime() {
        return applytime;
    }

    public void setApplytime(String applytime) {
        this.applytime = applytime;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public int getFilecopies() {
        return filecopies;
    }

    public void setFilecopies(int filecopies) {
        this.filecopies = filecopies;
    }

    public String getFiletype() {
        return filetype;
    }

    public void setFiletype(String filetype) {
        this.filetype = filetype;
    }

    public TypeEntity getType() {
        return type;
    }

    public void setType(TypeEntity type) {
        this.type = type;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public ArrayList<PeopleEntity> getAuditor() {
        return auditor;
    }

    public void setAuditor(ArrayList<PeopleEntity> auditor) {
        this.auditor = auditor;
    }

    public static class TypeEntity implements Parcelable{
        /**
         * dId : 1
         * dName : 公章
         */

        private int dId;
        private String dName;

        protected TypeEntity(Parcel in) {
            dId = in.readInt();
            dName = in.readString();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(dId);
            dest.writeString(dName);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<TypeEntity> CREATOR = new Creator<TypeEntity>() {
            @Override
            public TypeEntity createFromParcel(Parcel in) {
                return new TypeEntity(in);
            }

            @Override
            public TypeEntity[] newArray(int size) {
                return new TypeEntity[size];
            }
        };

        public int getDId() {
            return dId;
        }

        public void setDId(int dId) {
            this.dId = dId;
        }

        public String getDName() {
            return dName;
        }

        public void setDName(String dName) {
            this.dName = dName;
        }
    }


}
